package org.fang.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
 * @Author forsake
 * @Description 
 * @Date 17:20 2022/3/9
 **/  
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class PlatformResult implements Result{
    /**
     *
     */
    private static final long serialVersionUID = -4759913324592501472L;

    private Integer code;

    private String msg;

    private Object data;

    public static PlatformResult success() {
        PlatformResult result = new PlatformResult();
        result.setCode(10000);
        result.setMsg("成功");
        return result;
    }

    public static PlatformResult success(Object data) {
        PlatformResult result = new PlatformResult();
        result.setCode(10000);
        result.setData(data);
        return result;
    }
    public static PlatformResult failure(String message) {
        PlatformResult result = new PlatformResult();
        result.setCode(500);
        result.setMsg(message);
        return result;
    }


}
